const path      = require('path');
const webpack   = require('webpack');

const common = {
    entry: {
        "wrapper" : "./static/dashboard/js/src/wrapper.js"
    },
    output: {
        path: path.join(__dirname, 'static/dashboard/js'),
        filename: "[name].js"
    },
    module: {
        loaders: [
            {
                //loader: 'babel-loader',
                //test: /\.jsx?$/,
                // Enable caching for improved performance during development
                // It uses default OS directory by default. If you need something
                // more custom, pass a path to it. I.e., babel?cacheDirectory=<path>
                //loaders: ['babel?cacheDirectory,presets[]=react,presets[]=es2015'],
                // Parse only app files! Without this it will go through entire project.
                // In addition to being slow, that will most likely result in an error.
                test: /\.jsx?$/,
                loader: 'babel-loader',
                exclude: /node_modules/,
                query: {
                    presets: ['react', 'es2015']
                }
            }
        ]
    }
};

module.exports = common;